﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcmyjobs.Web.reward
{
    public partial class offer_en : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.Title = string.Format("揭榜悬赏招聘--猎头 猎头公司 聊城猎头 聊城猎头公司 {0}", Application["webname"].ToString());
                if (Request["rewardBh"] != null && Request["rewardName"]!= null)
                {
                    this.txtbh.Text = Request["rewardBh"];
                    this.txtjobsname.Text = Request["rewardName"];
                    
                }
            }
        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            string introducername = this.txtname.Text;
            int enterprise_reward_id = int.Parse(this.txtbh.Text);
            string infoperson = this.txtinfo.Text;
            string introducerid = this.txtofferID.Text;
            string mobilphone = this.txtphone.Text;
            string email = this.txtemail.Text;
            DateTime otime = DateTime.Now;
            int status = 0;

            lcmyjobs.Model.enterprise_offer model = new lcmyjobs.Model.enterprise_offer();
            model.introducername = introducername;
            model.enterprise_reward_id = enterprise_reward_id;
            model.infoperson = infoperson;
            model.introducerid = introducerid;
            model.mobilphone = mobilphone;
            model.email = email;
            model.otime = otime;
            model.status = status;

            lcmyjobs.BLL.enterprise_offer bll = new lcmyjobs.BLL.enterprise_offer();
            int re = bll.Add(model);
            if (re > 0)
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "揭榜该悬赏职位成功！", "enlist.html");
            }
            if (re == -1)
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "您已揭榜过该职位！", "enlist.html");
            }
        }
    }
}